how to solve for the inverse function